﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace sy3_1_3_
{
    internal class Circle
    {
        private double x, y, r;

        // 给圆心坐标和半径赋值
        public void SetValue(double x, double y, double r)
        {
            this.x = x;
            this.y = y;
            this.r = r;
        }

        // 求圆的面积
        public double GetArea()
        {
            return Math.Round(Math.PI * r * r, 2);
        }

        // 求圆的周长
        public double GetPerimeter()
        {
            return Math.Round(2 * Math.PI * r, 2);
        }

        // 求圆心到原点的距离
        public double GetDistance()
        {
            double distance = Math.Sqrt(x * x + y * y);
            return Math.Round(distance, 2);
        }
    }
}
